<template>
	<u-icon :size="size" :name="iconName" :label="title" :labelSize="titleSize" :labelColor="titleColor" :labelPos="mode" @click="emitClick"></u-icon>
</template>

<script>
	import iconMap from "./iconMap.json"
	export default {
		name: "MyIcon",
		computed: {
			iconName() {
				const {name} = this
				return iconMap[name]
			}
		},
		props: {
			name: {
				type: String,
				required: true,
			},
			title: {
				type: String,
				default: ""
			},
			size: {
				type: String | Number,
				default: "80",
			},
			titleColor: {
				type: String,
				default: "#606266"
			},
			titleSize: {
				type: String | Number,
				default: "26"
			},
			mode: {
				type: String,
				default: "top"
			},
			interval: {
				type: Number,
				default: 5
			}
		},
		methods:{
			emitClick(){
				this.$emit("click")
			}
		}
	}
</script>

<style>
</style>
